<?php
   $dropdown_category=array(
    'table_name' => 'zoo_categories',
    'key_field' => 'id',
    'value_field' => 'nomfr',
    'where'=> array('parent >'=>0)
);
?>

<div id="wrapper-content">
 <table class="titrepage" width="100%">
        <tr>
            <td >Information du produit</td>
      
        </tr>
    </table>
          <?php echo form_open_multipart(site_url('product_admin/add_product')); ?>
        <table align="center" width="100%" class="list" cellpadding="10px" cellspacing="0">
            <tr>
                <td>Nom du produit:</td>
                <td><input type="text" name="name" size="30" value="<?php echo set_value('name') ?>">
                <?php echo form_error('name');?></td>

            </tr>
            <tr>
                <td >Image:</td>
                <td><input size="30" type="file" name="userfile" id="userfile" size="25"/></td>

            </tr>
            <tr>
                <td>Categorie:</td>
                <td><?php echo form_dropdown('cat_id',dropdown_data($dropdown_category))?></td>

            </tr>
            <tr>
                <td>Quantité:</td>
                <td><input type="text" size="30" name="quantity" value="<?php echo set_value('quantity')?>">
                <?php echo form_error('quantity') ?> </td>

            </tr>
            <tr>
                <td>Prix:</td>
                <td><input type="text" size="30" name="price" value="<?php echo set_value('price')?>">
                <?php echo form_error('price') ?></td>

            </tr>
             <tr>
                <td>Poids:</td>
                <td><input type="text" size="30" name="poids" value="<?php echo set_value('poids')?>">
                <?php echo form_error('poids') ?></td>

            </tr>
            <tr>
                <td width="30%" >Description:</td>
                <td colspan="2">
                    <?php
                        $data = array('name' => 'description',
                        'id' => 'description',
                        'width' => '600',
                        'height' => '250',
                        'type' =>'text'
                        );
                        echo form_fckeditor($data);
                    ?>
                    <?php echo form_error('description'); ?>
                </td>

            </tr>
            <tr>
                <td>Promo:</td>
                <td><input type="text" size="30" name="promo" value="<?php echo set_value('promo')?>">
                <?php echo form_error('promo') ?></td>

            </tr>
            <tr>
                <td>
                <?php 
                    $coeur = array(
                    'name'        => 'coeur',
                    'id'          => 'coeur',
                    'value'       => 1,
                    'checked'     => TRUE,
                    'style'       => 'margin:10px',
                    );
                    echo 'Coeur'.form_checkbox($coeur);
                  ?>
                </td>
            </tr>
            <tr>
                <td><input type="submit" name="submit" value=" Ajouter "/></td>
            </tr>
        </table>

    <?php echo form_close() ?>
</div>

